#!/home/hewei/software/conda/envs/py3/bin/python
import os
from subprocess import call

tfp = "/public/data/zli/soft/anaconda2/envs/tf/bin/python"

files = os.listdir("./data/hits_data/")
IDs = [int(i.split("_")[-1].split(".")[0]) for i in files]
maxID = max(IDs)
minID = min(IDs)
del files
starts = [i for i in range(minID, maxID, 600)]
if maxID - starts[-1] < 599:
	tail = starts.pop(-1)
	batchs = [((i,i+200), (i+200,i+400), (i+400,i+600)) for i in starts]
	batchs.append((tail, maxID+1))

else:
	batchs = [((i,i+200), (i+200,i+400), (i+400,i+600)) for i in starts]


for batch in batchs:
	call("{} preprocess.py -e {} --mindocID {} --maxdocID {} & {} preprocess.py -e {} --mindocID {} --maxdocID {} & {} preprocess.py -e {} --mindocID {} --maxdocID {}".format(tfp, 0, batch[0][0], batch[0][1], tfp, 1, batch[1][0], batch[1][1], tfp, 2, batch[2][0], batch[2][1]))
	print("---->", batch[0][0])
		



